package cn.yiueil;

public class Handler1 extends Handler {

    public Handler1(Handler nextHandler) {
        super(nextHandler);
    }

    @Override
    public void handleRequest(int type) {
        if (type == 1) {
            System.out.println("handler1处理了类型为1的事件");
            return;
        }
        if (this.nextHandler != null) {
            this.nextHandler.handleRequest(type);
        } else {
            throw new RuntimeException("没能处理该事件");
        }
    }
}
